package com.fwmagic.rpc.proxy;

import com.fwmagic.rpc.handler.MyInvocationHandler;

import java.lang.reflect.Proxy;

/**
 * 动态代理接口
 */
public class RpcClientProxy {

    public <T> T clientProxy(Class<T> interfaceCls,String host,Integer port){
        return (T)Proxy.newProxyInstance(interfaceCls.getClassLoader(),new Class[]{interfaceCls}, new MyInvocationHandler(host,port));
    }
}
